Skip to content

Add health check to Directus service in Docker Compose example#615

Merged
bryantgillespie merged 6 commits intodirectus:mainfrom
mvanhorn:docs/add-directus-health-check
Apr 23, 2026
Merged

Add health check to Directus service in Docker Compose example#615
bryantgillespie merged 6 commits intodirectus:mainfrom
mvanhorn:docs/add-directus-health-check

Conversation

@mvanhorn
Copy link
Copy Markdown

Adds a healthcheck to the Directus service in the Docker Compose example and a short section explaining the two health endpoints.

The compose example already had health checks for Postgres and Redis but not for Directus itself. Other containers in the stack can now use depends_on: { directus: { condition: service_healthy } } to wait for Directus.

Also documents the difference between /server/health (checks dependencies) and /server/ping (HTTP-only), based on the discussion in #331.

Fixes #331

This contribution was developed with AI assistance (Claude Code).

@mvanhorn mvanhorn requested a review from a team as a code owner March 31, 2026 07:50
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 31, 2026

@mvanhorn is attempting to deploy a commit to the Directus Team on Vercel.

A member of the Team first needs to authorize it.

Add a healthcheck configuration to the directus service block and a
section explaining the /server/health and /server/ping endpoints. This
helps users who run other containers that need to wait for Directus.

Fixes directus#331
@mvanhorn mvanhorn force-pushed the docs/add-directus-health-check branch from f9542ce to 721a71d Compare March 31, 2026 12:57
Copy link
Copy Markdown
Member

@bryantgillespie bryantgillespie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition. One correction on the /server/health bullet — 503 is only returned when status is error. A warn status (which is what a missing email transport actually produces) still returns 200, so the current wording contradicts itself. Well that's not right either. I think the original wording you had for that part is fine for this.

Comment thread content/self-hosting/3.deploying.md Outdated
Comment thread content/self-hosting/3.deploying.md Outdated
Comment thread content/self-hosting/3.deploying.md Outdated
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Apr 23, 2026 2:46pm

Request Review

@bryantgillespie bryantgillespie merged commit 03dd5a9 into directus:main Apr 23, 2026
1 check failed
@mvanhorn
Copy link
Copy Markdown
Author

Thanks for landing the health check example, @bryantgillespie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Health Check Example for Self-Hosted Directus in Docker

2 participants